import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import p001 from './p001';

export default async function a001(fd: IFeidaoAiBrowserComponent, no: string) {
	// todo
	console.log('zj-000005:a001----start');
	const n = fd.data.node.querySelector<HTMLDivElement>('[data-id="update"]');
	set_node_cls(n, 'display-n', false);
	set(fd, 'no', no);

	const res = await nodejs<Array<{}>>('wyf/zj-000005/s001', {
		filter: {
			hidden_source_feature_no: no
		}
	});
	set(fd, 'data', res);
	console.log(res);
	if (res.length > 0) {
		// const data = res[0];//  获取第一个数据
		// console.log(data);
		render(fd, res, p001, 'p001', 'inner');
	}

	console.log('zj-000005:a001----end');
}
